package com.fuxi.cloud.desreport.model;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fuxi.cloud.desreport.entity.JimuReport;
import com.fuxi.cloud.desreport.render.b.b;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

/**
 * RenderInfo
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */
public class RenderInfo {
    private static final Logger log = LoggerFactory.getLogger(RenderInfo.class);
    private JimuReport report;
    private String strategyName;
    public JSONArray merges;
    private Integer len = 25;
    public JSONArray loopBlockList;
    public List<b> groupRightColumns = new LinkedList();
    public List<String> groupUpList = new ArrayList();
    public Map<String, JSONObject> eachRowObj = new LinkedHashMap();
    public List<b> groupColumnList = new LinkedList();

    public RenderInfo(JimuReport report) {
        this.report = report;
    }

    public void addMerges(JSONArray merges) {
        this.merges.addAll(merges);
    }

    public void addEachRow(String key, JSONObject row) {
        this.eachRowObj.put(key, row);
    }

    public List<b> getGroupRightColumn() {
        LinkedList var1 = new LinkedList();
        Iterator var2 = this.groupColumnList.iterator();

        while(var2.hasNext()) {
            b var3 = (b)var2.next();
            String var4 = var3.getDirection();
            if (var4.equals("right")) {
                var1.add(var3);
            }
        }

        return var1;
    }

    public List<b> getGroupUpColumn() {
        LinkedList var1 = new LinkedList();
        Iterator var2 = this.groupColumnList.iterator();

        while(var2.hasNext()) {
            b var3 = (b)var2.next();
            String var4 = var3.getDirection();
            if (var4.equals("up")) {
                var1.add(var3);
            }
        }

        return var1;
    }

    public JimuReport getReport() {
        return this.report;
    }

    public String getStrategyName() {
        return this.strategyName;
    }

    public JSONArray getMerges() {
        return this.merges;
    }

    public Integer getLen() {
        return this.len;
    }

    public JSONArray getLoopBlockList() {
        return this.loopBlockList;
    }

    public List<b> getGroupRightColumns() {
        return this.groupRightColumns;
    }

    public List<String> getGroupUpList() {
        return this.groupUpList;
    }

    public Map<String, JSONObject> getEachRowObj() {
        return this.eachRowObj;
    }

    public List<b> getGroupColumnList() {
        return this.groupColumnList;
    }

    public void setReport(JimuReport report) {
        this.report = report;
    }

    public void setStrategyName(String strategyName) {
        this.strategyName = strategyName;
    }

    public void setMerges(JSONArray merges) {
        this.merges = merges;
    }

    public void setLen(Integer len) {
        this.len = len;
    }

    public void setLoopBlockList(JSONArray loopBlockList) {
        this.loopBlockList = loopBlockList;
    }

    public void setGroupRightColumns(List<b> groupRightColumns) {
        this.groupRightColumns = groupRightColumns;
    }

    public void setGroupUpList(List<String> groupUpList) {
        this.groupUpList = groupUpList;
    }

    public void setEachRowObj(Map<String, JSONObject> eachRowObj) {
        this.eachRowObj = eachRowObj;
    }

    public void setGroupColumnList(List<b> groupColumnList) {
        this.groupColumnList = groupColumnList;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof RenderInfo)) {
            return false;
        } else {
            RenderInfo var2 = (RenderInfo)o;
            if (!var2.canEqual(this)) {
                return false;
            } else {
                label119: {
                    Integer var3 = this.getLen();
                    Integer var4 = var2.getLen();
                    if (var3 == null) {
                        if (var4 == null) {
                            break label119;
                        }
                    } else if (var3.equals(var4)) {
                        break label119;
                    }

                    return false;
                }

                JimuReport var5 = this.getReport();
                JimuReport var6 = var2.getReport();
                if (var5 == null) {
                    if (var6 != null) {
                        return false;
                    }
                } else if (!var5.equals(var6)) {
                    return false;
                }

                label105: {
                    String var7 = this.getStrategyName();
                    String var8 = var2.getStrategyName();
                    if (var7 == null) {
                        if (var8 == null) {
                            break label105;
                        }
                    } else if (var7.equals(var8)) {
                        break label105;
                    }

                    return false;
                }

                JSONArray var9 = this.getMerges();
                JSONArray var10 = var2.getMerges();
                if (var9 == null) {
                    if (var10 != null) {
                        return false;
                    }
                } else if (!var9.equals(var10)) {
                    return false;
                }

                label91: {
                    JSONArray var11 = this.getLoopBlockList();
                    JSONArray var12 = var2.getLoopBlockList();
                    if (var11 == null) {
                        if (var12 == null) {
                            break label91;
                        }
                    } else if (var11.equals(var12)) {
                        break label91;
                    }

                    return false;
                }

                List var13 = this.getGroupRightColumns();
                List var14 = var2.getGroupRightColumns();
                if (var13 == null) {
                    if (var14 != null) {
                        return false;
                    }
                } else if (!var13.equals(var14)) {
                    return false;
                }

                label77: {
                    List var15 = this.getGroupUpList();
                    List var16 = var2.getGroupUpList();
                    if (var15 == null) {
                        if (var16 == null) {
                            break label77;
                        }
                    } else if (var15.equals(var16)) {
                        break label77;
                    }

                    return false;
                }

                label70: {
                    Map var17 = this.getEachRowObj();
                    Map var18 = var2.getEachRowObj();
                    if (var17 == null) {
                        if (var18 == null) {
                            break label70;
                        }
                    } else if (var17.equals(var18)) {
                        break label70;
                    }

                    return false;
                }

                List var19 = this.getGroupColumnList();
                List var20 = var2.getGroupColumnList();
                if (var19 == null) {
                    if (var20 != null) {
                        return false;
                    }
                } else if (!var19.equals(var20)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof RenderInfo;
    }

    @Override
    public int hashCode() {
        boolean var1 = true;
        byte var2 = 1;
        Integer var3 = this.getLen();
        int var12 = var2 * 59 + (var3 == null ? 43 : var3.hashCode());
        JimuReport var4 = this.getReport();
        var12 = var12 * 59 + (var4 == null ? 43 : var4.hashCode());
        String var5 = this.getStrategyName();
        var12 = var12 * 59 + (var5 == null ? 43 : var5.hashCode());
        JSONArray var6 = this.getMerges();
        var12 = var12 * 59 + (var6 == null ? 43 : var6.hashCode());
        JSONArray var7 = this.getLoopBlockList();
        var12 = var12 * 59 + (var7 == null ? 43 : var7.hashCode());
        List var8 = this.getGroupRightColumns();
        var12 = var12 * 59 + (var8 == null ? 43 : var8.hashCode());
        List var9 = this.getGroupUpList();
        var12 = var12 * 59 + (var9 == null ? 43 : var9.hashCode());
        Map var10 = this.getEachRowObj();
        var12 = var12 * 59 + (var10 == null ? 43 : var10.hashCode());
        List var11 = this.getGroupColumnList();
        var12 = var12 * 59 + (var11 == null ? 43 : var11.hashCode());
        return var12;
    }

    @Override
    public String toString() {
        return "RenderInfo(report=" + this.getReport() + ", strategyName=" + this.getStrategyName() + ", merges=" + this.getMerges() + ", len=" + this.getLen() + ", loopBlockList=" + this.getLoopBlockList() + ", groupRightColumns=" + this.getGroupRightColumns() + ", groupUpList=" + this.getGroupUpList() + ", eachRowObj=" + this.getEachRowObj() + ", groupColumnList=" + this.getGroupColumnList() + ")";
    }
}

